home *** CD-ROM | disk | FTP | other *** search
- /*
- File: InstallerScript.h
-
- Contains: xxx put contents here xxx
-
- Version: Technology:
- Package: 4.1a2
-
- Copyright: © 1984-1995 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
-
- #ifndef __INSTALLERSCRIPT__
- #define __INSTALLERSCRIPT__
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
- /* #include <Types.h> */
- /* #include <ConditionalMacros.h> */
- /* #include <MixedMode.h> */
- /* #include <OSUtils.h> */
- /* #include <Memory.h> */
- /* #include <Patches.h> */
- /* #include <Kernel.h> */
- /* #include <Errors.h> */
- /* #include <MachineExceptions.h> */
- /* #include <Timing.h> */
- /* #include <OrderedItems.h> */
- /* #include <Finder.h> */
-
- #ifndef __MEMORY__
- #include <Memory.h>
- #endif
-
- #ifndef __MIXEDMODE__
- #include <MixedMode.h>
- #endif
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #define kMaxNumOfFunctionParams 12
- struct CallBackPBRec {
- long fSelector;
- long fResult;
- long fParam[12];
- };
- typedef struct CallBackPBRec CallBackPBRec, *CallBackPBPtr;
-
- typedef long (*InstallerCallBackProcPtr)(CallBackPBPtr);
-
- #if GENERATINGCFM
- typedef UniversalProcPtr InstallerCallBackUPP;
- #else
- typedef InstallerCallBackProcPtr InstallerCallBackUPP;
- #endif
-
- enum {
- uppInstallerCallBackProcInfo = kCStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(long)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(CallBackPBPtr)))
- };
-
- #if GENERATINGCFM
- #define NewInstallerCallBackProc(userRoutine) \
- (InstallerCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppInstallerCallBackProcInfo, GetCurrentArchitecture())
- #else
- #define NewInstallerCallBackProc(userRoutine) \
- ((InstallerCallBackUPP) (userRoutine))
- #endif
-
- #if GENERATINGCFM
- #define CallInstallerCallBackProc(userRoutine, parameter0) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppInstallerCallBackProcInfo, (parameter0))
- #else
- #define CallInstallerCallBackProc(userRoutine, parameter0) \
- (*(userRoutine))((parameter0))
- #endif
-
- /*****************************************************************************************************/
- /**/
- /* Rule Function*/
- /**/
- /**/
- /* Code Resource Calling Interface:*/
- /**/
- /* long YourRuleFunction( RuleFunctionPBPtr );*/
- /**/
- /*****************************************************************************************************/
- #define kTRUERuleFunctionResult 1
- #define kFALSERuleFunctionResult 0
- struct RuleFunctionPBRec {
- InstallerCallBackUPP fCallBackProcPtr;
- short fTargetVRefNum;
- long fTargetFolderDirID;
- short fSystemVRefNum;
- long fSystemBlessedDirID;
- long fRefCon;
- };
- typedef struct RuleFunctionPBRec RuleFunctionPBRec, *RuleFunctionPBPtr;
-
- /*****************************************************************************************************/
- /**/
- /* Action Atom Function*/
- /**/
- /**/
- /* Code Resource Calling Interface:*/
- /**/
- /* long YourActionAtomFunction( ActionAtom2PBPtr );*/
- /**/
- /*****************************************************************************************************/
-
- enum {
- before,
- after,
- cleanUpCancel
- };
-
- typedef SInt8 InstallationStage;
-
-
- enum {
- kActionAtomResultFatalError = -1,
- kActionAtomResultContinue = 0,
- kActionAtomResultCancel = 1
- };
-
- typedef long ActionAtomResult;
-
- struct ActionAtom2PBRec {
- InstallationStage fMessageID;
- SInt8 padByte;
- Handle fStaticDataHdl;
- InstallerCallBackUPP fCallBackProcPtr;
- short fTargetVRefNum;
- long fTargetFolderDirID;
- short fSystemVRefNum;
- long fSystemBlessedDirID;
- long fRefCon;
- Boolean fDoingInstall;
- Boolean fDidLiveUpdate;
- long fInstallerTempDirID;
- };
- typedef struct ActionAtom2PBRec ActionAtom2PBRec, *ActionAtom2PBPtr;
-
- /*****************************************************************************************************/
- /**/
- /* Version Compare Function*/
- /**/
- /**/
- /* Code Resource Calling Interface:*/
- /**/
- /* long YourComputeVersionFunctionSetupFunction( ComputeVersionPBPtr );*/
- /**/
- /* Return the version in BCD format. For example: ver 2.0.1 final release is 0x02018000*/
- /**/
- /*****************************************************************************************************/
- struct ComputeVersionPB {
- InstallerCallBackUPP fCallBackProcPtr;
- };
- typedef struct ComputeVersionPB ComputeVersionPB, *ComputeVersionPBPtr;
-
- /*****************************************************************************************************/
- /**/
- /* Target Search Function*/
- /**/
- /**/
- /* Code Resource Calling Interface:*/
- /**/
- /* SearchResult YourTargetSearchFunction( SearchProcedurePBPtr );*/
- /**/
- /*****************************************************************************************************/
-
- enum {
- kFatalSearchError = -1,
- kSearchSuccessful = 0,
- kCancelSearchAndInstallation = 1
- };
-
- typedef SInt8 SearchResult;
-
- struct FoundFileRec {
- short vRefNum;
- long parID;
- Str63 name;
- short fReferenceID;
- };
- typedef struct FoundFileRec FoundFileRec, *FoundFileArrayPtr, **FoundFileArrayHdl;
-
- struct SearchProcedurePBRec {
- InstallerCallBackUPP fCallBackProcPtr;
- short fTargetVRefNum;
- long fTargetFolderDirID;
- short fSystemVRefNum;
- long fSystemBlessedDirID;
- long fRefCon;
- OSType fFileSpecType;
- OSType fFileSpecCreator;
- long fFileSpecCrDate;
- Str255 fFileSpecPath;
- FoundFileArrayHdl fFoundFilesArray;
- };
- typedef struct SearchProcedurePBRec SearchProcedurePBRec, *SearchProcedurePBPtr;
-
- /*****************************************************************************************************/
- /**/
- /* Setup Function*/
- /**/
- /**/
- /* Code Resource Calling Interface:*/
- /**/
- /* long YourSetupFunction( EnvironmentSetupPBPtr );*/
- /**/
- /*****************************************************************************************************/
- #define kContinueInstallerSetup 0
- #define kQuitInstallerNow -1
- struct EnvironmentSetupPB {
- InstallerCallBackUPP fCallBackProcPtr;
- FSSpec fTargetFSSpec;
- short fSystemVRefNum;
- };
- typedef struct EnvironmentSetupPB *EnvironmentSetupPBPtr;
-
- /*****************************************************************************************************/
- /**/
- /* Atom Extender Function*/
- /**/
- /**/
- /* Code Resource Calling Interface:*/
- /**/
- /* long YourAtomExtenderFunction( ExtenderPBPtr );*/
- /**/
- /*****************************************************************************************************/
-
- enum {
- kFileAtomDataFork,
- kFileAtomRsrcFork,
- kFileAtomRsrcForkFromDataFork,
- kRsrcAtom,
- kFontAtom,
- kActionAtom
- };
-
- typedef SInt8 DataType;
-
-
- enum {
- kFatalError = -1,
- kContinueAsNormal = 0,
- kCancelInstallation = 1,
- kCopiedData
- };
-
- typedef SInt16 ExtenderResultCode;
-
-
- enum {
- kInitialize,
- kBeforePart,
- kAfterPart,
- kSuccess,
- kCancel
- };
-
- typedef SInt8 ExtenderMessageID;
-
- struct EnvironsHeaderRec {
- ExtenderMessageID fMessageID;
- SInt8 pad1;
- Handle fStaticDataHdl;
- InstallerCallBackUPP fCallBackProcPtr;
- short fTargetVRefNum;
- long fTargetFolderDirID;
- short fSystemVRefNum;
- long fSystemBlessedDirID;
- long fRefCon;
- DataType fDataType;
- SInt8 pad2;
- };
- typedef struct EnvironsHeaderRec EnvironsHeaderRec;
-
- struct CopyHeaderRec {
- FSSpec fSourceFile;
- FSSpec fTargetFile;
- long fTotalTargetSize;
- long fTargetPosStart;
- long fTargetPartSize;
- long fSourcePartSize;
- long fInstallerTempDirID;
- };
- typedef struct CopyHeaderRec CopyHeaderRec;
-
- struct BasicCopyRec {
- EnvironsHeaderRec fEnvironmentHeader;
- CopyHeaderRec fCopyPBHeader;
- };
- typedef struct BasicCopyRec BasicCopyRec;
-
- struct RsrcCopyRec {
- EnvironsHeaderRec fEnvironmentHeader;
- CopyHeaderRec fCopyPBHeader;
- ResType fSourceRsrcType;
- short fSourceRsrcID;
- ResType fTargetRsrcType;
- short fTargetRsrcID;
- Str255 fTargetRsrcName;
- short fTargetRsrcAttrs;
- };
- typedef struct RsrcCopyRec RsrcCopyRec;
-
- struct FontCopyRec {
- EnvironsHeaderRec fEnvironmentHeader;
- CopyHeaderRec fCopyPBHeader;
- ResType fSourceFontRsrcType;
- short fSourceFontRsrcID;
- ResType fTargetFontRsrcType; /* FONT, NFNT, or sfnt*/
- short fTargetFontRsrcID;
- Str255 fTargetFontRsrcName;
- short fTargetFontRsrcAttrs;
- Str255 fFamilyName;
- short fFamilyID;
- short fFontSize;
- short fFontStyle;
- };
- typedef struct FontCopyRec FontCopyRec;
-
- union ExtenderPBRec {
- BasicCopyRec fBasicPBRec;
- BasicCopyRec fFileCopyPBRec;
- RsrcCopyRec fRsrcCopyPBRec;
- FontCopyRec fFontCopyPBRec;
- };
- typedef union ExtenderPBRec *ExtenderPBPtr;
-
- /*****************************************************************************************************/
- /**/
- /* Callback Glue Routines*/
- /**/
- /*****************************************************************************************************/
- /* Memory Related*/
- extern Handle INewHandle(InstallerCallBackUPP pCallBackProcPtr, unsigned long newHandleSize);
- extern void IDisposHandle(InstallerCallBackUPP pCallBackProcPtr, Handle storageHandle);
- extern void IHLock(InstallerCallBackUPP pCallBackProcPtr, Handle storageHandle);
- extern void IHUnLock(InstallerCallBackUPP pCallBackProcPtr, Handle storageHandle);
- /* Atom Extender Related*/
- extern OSErr ReadSourceData(InstallerCallBackUPP pCallBackProcPtr, long *count, Ptr storagePtr);
- extern OSErr WriteTargetData(InstallerCallBackUPP pCallBackProcPtr, long count, Ptr storagePtr);
- extern OSErr ReadTargetData(InstallerCallBackUPP pCallBackProcPtr, long *count, Ptr storagePtr);
- extern OSErr SetTargetDataPos(InstallerCallBackUPP pCallBackProcPtr, short positionMode, long positionOffset);
- extern OSErr GetTargetDataPos(InstallerCallBackUPP pCallBackProcPtr, long *positionOffset);
- extern OSErr GetTargetDataEOF(InstallerCallBackUPP pCallBackProcPtr, long *theLength);
- extern OSErr SetSourceDataPos(InstallerCallBackUPP pCallBackProcPtr, short positionMode, long positionOffset);
- extern OSErr GetSourceDataPos(InstallerCallBackUPP pCallBackProcPtr, long *positionOffset);
- extern OSErr GetSourceDataEOF(InstallerCallBackUPP pCallBackProcPtr, long *theLength);
- /* Action Atom Related*/
- extern OSErr MakeFSSpecFromFileSpecID(InstallerCallBackUPP pCallBackProcPtr, short pFileSpecID, FSSpec *pFSSpecPtr, StringHandle *pExtraPathInfo);
- extern void SuspendWaitCursor(InstallerCallBackUPP pCallBackProcPtr);
- extern void ResumeWaitCursor(InstallerCallBackUPP pCallBackProcPtr);
- extern void IncrementStatusBar(InstallerCallBackUPP pCallBackProcPtr, short pIncrementAmount);
- extern Boolean IsUserInteractionAllowed(InstallerCallBackUPP pCallBackProcPtr);
- /*****************************************************************************************************/
- /**/
- /* Obsolete Interfaces*/
- /**/
- /*****************************************************************************************************/
- /* Old Action Atom Parameter Block*/
- struct AAPBRec {
- short targetVRefNum;
- long blessedDirID;
- long aaRefCon;
- Boolean doingInstall;
- InstallationStage whichStage;
- Boolean didLiveUpdate;
- SInt8 padByte;
- long installerTempDirID;
- };
- typedef struct AAPBRec *AAPBRecPtr;
-
- /* Action Handler Parameter Block*/
- struct ActionHandlerPB {
- Handle fStaticDataHdl;
- InstallerCallBackUPP fCallBackProcPtr;
- short fTargetVRefNum;
- long fTargetFolderDirID;
- short fSystemVRefNum;
- long fSystemBlessedDirID;
- short fActionClassID;
- short fActionIdentifier;
- void *fParam0;
- void *fParam1;
- void *fParam2;
- void *fParam3;
- void *fResultPtr;
- };
- typedef struct ActionHandlerPB *ActionHandlerPBPtr;
-
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __INSTALLERSCRIPT__ */
-